import axiosInstance from '@/tools/request'
import type { SysUser } from '@/api/sysUser/sysUser.d' // 这里时你将 sys_user.d.ts 存放的位置

//sysUserAdd 系统用户添加
export const sysUserAdd = (sysUser: SysUser) => {
  return axiosInstance({
    url: `/sysUser`,
    method: 'post',
    data: sysUser
  })
}

//sysUserRemove 系统用户删除
export const sysUserRemove = (sysUserId: number) => {
  return axiosInstance({
    url: `/sysUser/${ sysUserId }`,
    method: 'delete'
  })
}

//sysUserModify 系统用户修改
export const sysUserModify = (sysUser: SysUser) => {
  return axiosInstance({
    url: `/sysUser`,
    method: 'put',
    data: sysUser
  })
}

//sysUserList 系统用户列表
export const sysUserList = (sysUser:SysUser, params: any) => {
  return axiosInstance({
    url: '/sysUser/list',
    method: 'post',
    params: params,
    data: sysUser
  })
}

//sysUserById 系统用户查询通过ID
export const sysUserById = (sysUserId: number) => {
  return axiosInstance({
    url: `/sysUser/${ sysUserId }`,
    method: 'get'
  })
}

//sysUserRemoveBatch 系统用户删除系统缓存
export const sysUserRemoveBatch = (ids: any[]) => {
  return axiosInstance({
    url: `/sysUser/batchDelete`,
    method: 'delete',
    params: {
      ids:ids
    }
  })
}
